package com.nstar.orderexpress.model
{
	import com.adobe.cairngorm.model.ModelLocator;
	import com.nstar.orderexpress.view.OrderExpressApp;

	[Bindable]
	public class Model implements ModelLocator
	{
		private static var model:Model;
		
		public var mainApp:OrderExpressApp;//应用的引用
		
		//单例模式
		public static function getInstance():Model 
		{
			if ( model == null )
				model = new Model();
				
			return model;
	   }		
	   
	   	// Constructor should be private but current AS3.0 does not allow it yet (?)...
	   	public function Model() 
	   	{	
	   		if ( Model.model != null )
				throw new Error( "Only one ModelLocator instance should be instantiated" );	
	   	}	   
	}
}